package net.sky.oa.test.dao.docs;

import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.docs.FileAttachDao;
import net.sky.oa.model.FileAttach;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class FileAttachDaoTestCase extends BaseTestCase {
	
	@Resource
	private FileAttachDao fileAttachDao;
	
	@Test
	@Rollback(value=false)
	public void add(){
		FileAttach fileAttach=new FileAttach();
		fileAttach.setFileName("I L U");
		//offTask.setContent("This is a Task!");
		System.out.println("add methods!");
		fileAttachDao.save(fileAttach);
	}
	
	@Test
	public void list(){
		List<FileAttach> list=fileAttachDao.getAll();
		System.out.println(list.size());
		for(FileAttach op:list){
			System.out.println(op.getFileName()+"-------> "+op.getFilePath());
		}
	}
	
	@Test
	@Rollback(false)
	public void delete(){
		try {
			fileAttachDao.remove(1L);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
